<template>
  <div>
    <div>
      <el-table
        border
        ref="multipleTable"
        :data="applyData"
        tooltip-effect="dark"
        style="width: 100%;cursor: pointer"
      >
        <el-table-column
          prop="adminName"
          label="申请人"
        >
        </el-table-column>
        <el-table-column
          prop="applyDate"
          label="申请日期"
        >
        </el-table-column>

        <el-table-column
          prop="roomStatus"
          label="申请状态"
        >
          <template slot-scope="scope">
            <el-tag v-if="scope.row.applyStatus === 0" type="warning">
             审批中
            </el-tag>
            <el-tag v-if="scope.row.applyStatus === 1" type="success">
              审批成功
            </el-tag>
            <el-tag v-if="scope.row.applyStatus === 2" type="danger">
              审批失败
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column
          prop="applyStage"
          label="申请阶段"
        >
          <template slot-scope="scope">
            <el-tag v-if="scope.row.applyStage === 0" type="warning">
              主管审批中
            </el-tag>
            <el-tag v-if="scope.row.applyStage === 1" type="warning">
              经理审批中
            </el-tag>
            <el-tag v-if="scope.row.applyStage === 2" type="success">
              审批结束
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column
          prop="leaveReason"
          label="请假原因"
        >
        </el-table-column>
        <el-table-column
          prop="firstDate"
          label="请假开始日期"
        >
        </el-table-column>
        <el-table-column
          prop="lastDate"
          label="请假结束日期"
        >
        </el-table-column>

        <el-table-column
          prop="createTime"
          label="创建时间"
        >
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import leaveAPI from "../../../api/leave";
export default {
  name: "MyLeaveApply",
  data(){
    return {
      applyData:[],
    }
  },
  methods:{
    getData(){
      this.getMyApplyData()
    },
    getMyApplyData(){
      leaveAPI.getMyRecord().then(res => {
        if (res){
          this.applyData = res.data.obj
        }
      })
    }
  },
  mounted() {
    this.getData()
  }
}
</script>

<style scoped>

</style>
